﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Things.OrderPlan;

namespace Things.Web.OrderPlan
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PlanningGoodsSearcher searcher = new PlanningGoodsSearcher();
                this.DataList1.DataSource = searcher.FindAll();
                this.DataList1.DataBind();
            }
        }

        protected string GetUserName(string userAccount)
        {
            Things.BLL.BuyerInfo biBLL = new BLL.BuyerInfo();
            return biBLL.GetUserName(userAccount);
        }

        protected string GetLowestPrice(string strGoodsId)
        {
            string result = "请看详细信息";
            Guid goodsID = new Guid(strGoodsId);
            Things.OrderPlan.Models.SetParameter parameter = new Things.OrderPlan.SetParameterRepository().Find(goodsID);
            if (parameter != null)
            {
                result = Math.Round(parameter.PN, 2).ToString();
            }

            return result;
        }
    }
}